<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>系统分类键基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/systemStatic/style/admin.css">
    <link rel="stylesheet" href="${ctx}/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/css/public.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
</head>
<body>

<script type="text/html" template>
<form class="layui-form"  requrl="{{ serverPath.basePath }}/system/sysTypeKey/get"style="padding: 0px 30px;width: 440px;margin-left: auto;margin-right: auto" lay-filter="sysTypeKeyDataForm">

    <div style="margin: 15px 0px;height: 171px;overflow: auto;">
        <div class="layui-form-item" style="display:none;">
            <label class="layui-form-label">typeId</label>
            <div class="layui-input-block">
                <input type="text" name="typeId"  placeholder="请输入typeId"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="typeId">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">分类名称</label>
            <div class="layui-input-block">
                <input type="text" name="typeName"  placeholder="请输入分类名称"
                       autocomplete="off" class="layui-input " lay-verify="required" maxlength="50" fieldname="typeName">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">分类Key</label>
            <div class="layui-input-block">
                <input type="text" name="typeKey"  placeholder="请输入分类Key"
                       autocomplete="off" class="layui-input " lay-verify="required" maxlength="50" fieldname="typeKey">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-block">
                <input type="radio" name="type"lay-filter="type" value="0" title="平铺结构"/>
                <input type="radio" name="type"lay-filter="type" value="1" title="树形结构" checked/>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div style="text-align: center;">
                <a lay-submit lay-filter="sysTypeKey" class="layui-btn btn-n" requrl="{{serverPath.basePath}}/system/sysTypeKey/save">提交</a>
            <button type="reset" id="closeWindow" style="margin-left: 10px;" class="layui-btn btn-n layui-btn-danger btn-save">取消</button>
        </div>
    </div>
</form>
</script>
<script src="${ctx}/public/component.js" type="text/javascript"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>

    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','common','laydate','jquery','commons'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var commons = layui.commons;
        var dateTimeFiledLen = $(".dateTimeFiled");
        for(var i=0;i<dateTimeFiledLen.length;i++){
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                ,type: 'date'
                ,trigger: 'click'
            });
        }

        //关闭当前页面
        $("#closeWindow").click(function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        });

        var runId = "${runId}";
        if(runId == null || runId == ''){
            $("#hideAndShow").show();
        }

        var common = layui.common;
        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name:'sysTypeKeyDataForm',
            idValue:"${typeId}",
            primary:"typeId",
            updateCallback:function (data) {
                if (common.filterRecord(data)) {
                    window.parent.layer.alert(data.msg, function (index) {
                        parent.layer.close(index);
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                        parent.layui.table.reload('sysTypeKeyTable');
                        parent.layui.totalFilter.init('sysTypeKeyTable');
                    });
                } else {
                    window.parent.layer.alert(data.msg);
                }
                return false;
            }
        });
    });
</script>
</body>
</html>